#pragma once
#ifndef MODEL_HPP
#define MODEL_HPP

#include <iostream>
#include <vector>
#include <string>

#include <assimp/postprocess.h>
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <glm/glm.hpp>

#include "Texture.hpp"
#include "Mesh.hpp"

class Model
{
public:
	std::vector<Mesh> meshes;
	std::vector<Texture*> texture_cache;

	Model() {};
	Model(std::string mdlPath);
	void init (std::string mdlPath);
	void draw() const;

private:
	std::string path;
	std::vector<aiString> texture_filenames;
	void getMeshes(aiNode* node, const aiScene* scene);
	Mesh createMesh(aiMesh* mesh, const aiScene* scene);
	void loadTextures(const aiMaterial* material, aiTextureType aitype, std::string type);
};
#endif // MODEL_HPP
